<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css"
          href="../../../res/layui/css/layui.css" media="all">
    <script src="../../../res/layui/layui.js"></script>
    <script src="../../../res/js/jquery-3.4.1.min.js"></script>
    <script src="../../../res/js/util.js"></script>
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>审核信息填写</legend>
</fieldset>
<form class="layui-form" action="" lay-filter='myform' id="myform">
    <div class="layui-form-item">
        <label class="layui-form-label">是否通过</label>
        <div class="layui-input-block" style="width:200px;">
            <select name="isva" id="isva">
                <option value="1">是</option>
                <option value="2">否</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">审核意见</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入内容" lay-verify="required" maxlength="50" style="width:280px;" id="reviewRemark" name="reviewRemark"
                      class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="button" class="layui-btn" lay-submit="" lay-filter="myform" value="提交">
            <button id="closeAdd" type="button" class="layui-btn layui-btn-primary">取消</button>
        </div>
    </div>
</form>
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        //监听提交
        var s=0;
        form.on('submit(myform)', function (data) {
            s++;
            if (s ===1){
                //获取所有的节点数据 包括父节点id
                var url = getRootPath()+'auditRecord/update';
                var data2= {"id":getQueryString("Id")
                            ,"isva":$("#isva").val()
                            ,"reviewRemark":$("#reviewRemark").val()
                            }
                //表单赋值
                $.post(url, data2, function (obj) {
                    console.info(obj)
                    if (obj.status === 1) {
                        //关闭当前弹出层
                        parent.closeOpen(obj.message);//调用父页面的关闭方法
                    }else{
                        parent.closeOpen(obj.message);
                    }
                }, "json");
            }
        });
        //取消按钮
        $('#closeAdd').on('click', function (obj) {
            parent.quxiao();//调用父页面的取消方法
        });

    });
</script>
</body>
</html>